import moment from 'moment'
import * as CONST from '@/const'
import API from '@/api'
import * as types from '@/store/mutation-types'

export function render_list(list, fn) {
    var vnode = [];
    try {
        if (list.length == 0) {
            return vnode;
        }
        list.forEach((item, index) => {
            vnode.push(fn(item, index));
        });
    } catch (e) { }
    return vnode;
}
export function render_obj(obj, fn) {
    var piece = [];
    for (let prop in obj) {
        piece.push(fn(prop, obj[prop]));
    }
    return piece;
}
